package chalmers.game.subterranean.model;

import chalmers.game.subterranean.model.inventory.Inventory;
import chalmers.game.subterranean.util.Resource;
import java.util.List;

/**
 * Dummy class for now
 * 
 * @author TH
 */
public class Shop {

  private List<Resource> items;
  private Inventory inventory;

  public Shop() {
    items.add(Resource.PLACABLE_LADDER);
    items.add(Resource.UPGRADE_JUMPINGHEIGHT);
  }

  public void openShop(Inventory inventory) {
    this.inventory = inventory;
  }

  public void closeShop() {
    inventory = null;
  }

  public void buy(Resource item) {
    inventory.setMoney(inventory.getMoney() - item.getCost());
    inventory.add(item);
  }

  public void upgrade(Resource item) {

  }

  public void sell() {
    int cashReturned;
  }

  public void addItem(Resource i) {
    items.add(i);
  }

  public void removeItem(Resource i) {
    for (Resource item : items) {
      if (item == i) {
        items.remove(i);
      }
    }
  }
}
